library(tidyverse)
library(fixest)
library(showtext)
library(vtable)
library(writexl)
library(haven)
library(gridExtra)

setwd('D:\\WorkingPaper-Series\\Township_Light\\Replication_Files\\workdata')

#################################
########## Figure 2 #############
#################################

township_panel_final <- read_dta('township_panel_final.dta')

township_panel_final %>% 
  group_by(year) %>% 
  summarise(digit_village_mean = mean(digit_village)) %>% 
  ggplot()+
  geom_vline(aes(xintercept = 2016),color = '#5C5C5C', lty = 2, lwd = 1)+
  geom_point(aes(year, digit_village_mean))+
  geom_line(aes(year, digit_village_mean))+
  theme_bw()+
  theme(text = element_text(family = 'serif',size = 8),
        axis.text =  element_text(family = 'serif',size = 8))+
  scale_x_continuous(breaks = c(seq(2010,2020,2)))+
  labs(y = 'Average Keyword Frequency', x = 'Year')

